//
//  DoctorDetailSelectCell.swift
//  EyeVisionForPatients
//
//  Created by Mr.Lin. on 2020/3/17.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

protocol DoctorDetailSelectCellDelegate: NSObjectProtocol {
    func doctorDetailSelectCell(actionBtn: UIButton)
}

class DoctorDetailSelectCell: UITableViewCell {
    
    weak var delegate: DoctorDetailSelectCellDelegate?
    
    func updateData(vm: DoctorDetailViewModel) {
//        advisoryLabel.text = "\(vm.regFee)/次"
    }
    
    @IBOutlet weak var registrationBtn: UIButton!
    @IBOutlet weak var advisoryBtn: UIButton!
    @IBOutlet weak var cloudBtn: UIButton!
    @IBOutlet weak var registrationLabel: UILabel!
    @IBOutlet weak var advisoryLabel: UILabel!
    @IBOutlet weak var cloudLabel: UILabel!
    
    
    @IBAction func registrationBtnAcion(_ sender: Any) {
        registrationBtn.isSelected = true
        cloudBtn.isSelected = false
        advisoryBtn.isSelected = false
        self.delegate?.doctorDetailSelectCell(actionBtn: sender as!UIButton)
    }
    
    @IBAction func advisoryBtnAction(_ sender: Any) {
        registrationBtn.isSelected = false
        cloudBtn.isSelected = false
        advisoryBtn.isSelected = true
        self.delegate?.doctorDetailSelectCell(actionBtn: sender as! UIButton)
    }
    
    @IBAction func cloudBtnAction(_ sender: Any) {
        registrationBtn.isSelected = false
        cloudBtn.isSelected = true
        advisoryBtn.isSelected = false
        self.delegate?.doctorDetailSelectCell(actionBtn: sender as! UIButton)
    }
    
    
    func setUI() {
        self.contentView.addSubview(advisoryBtn)
        self.contentView.addSubview(cloudBtn)
    }
    
}
